package com.netease.pris.protocol;

import android.content.Context;
import android.text.TextUtils;
import com.netease.framework.a.m;
import com.netease.pris.a.q;
import com.netease.pris.a.u;
import com.netease.pris.b.a;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class e
{
  public static final int a = 0;
  public static final int b = 1;
  public static final int c = 2;
  public static final int d = 3;

  private static String a(int paramInt)
  {
    String str = null;
    switch (paramInt)
    {
    default:
    case 1:
    case 2:
    case 3:
    }
    while (true)
    {
      return str;
      str = "baidu";
      continue;
      str = "wikipedia";
      continue;
      str = "youdao";
    }
  }

  public static String a(Context paramContext, String paramString)
  {
    if (TextUtils.isEmpty(paramString));
    m localm;
    for (String str = null; ; str = localm.b())
    {
      return str;
      localm = new m("http://dict.youdao.com/dp/fy");
      localm.a("i", paramString);
      localm.a("keyfrom", "com.netease.pris");
      localm.a("vendor", "yuedu");
      localm.a("imei", u.g(paramContext));
      localm.a("mid", q.b());
      localm.a("model", u.b());
      localm.a();
    }
  }

  public static String a(String paramString)
  {
    return a(paramString, 0);
  }

  public static String a(String paramString, int paramInt)
  {
    Object localObject1 = a.N();
    Object localObject2;
    if (localObject1 != null)
    {
      if (!((String)localObject1).startsWith("/"))
        break label127;
      localObject2 = "http://easyread.163.com" + (String)localObject1;
    }
    while (true)
      try
      {
        String str3 = ((String)localObject2).replace("{searchTerms}", URLEncoder.encode(paramString, "utf-8"));
        localObject1 = str3;
        if ((paramInt <= 0) || (paramInt > 3))
          continue;
        String str1 = a(paramInt);
        if (((String)localObject1).indexOf('?') < 0)
          continue;
        str2 = (String)localObject1 + '&';
        localObject1 = str2 + "from=" + str1;
        return localObject1;
        label127: if (((String)localObject1).startsWith("http://"))
          continue;
        localObject2 = "http://" + (String)localObject1;
        continue;
      }
      catch (UnsupportedEncodingException localUnsupportedEncodingException)
      {
        localUnsupportedEncodingException.printStackTrace();
        localObject1 = localObject2;
        continue;
        String str2 = (String)localObject1 + '?';
        continue;
        localObject2 = localObject1;
      }
  }

  private static boolean b(String paramString)
  {
    int i = 0;
    if (paramString != null)
    {
      int j = 0;
      while (true)
        if (j < paramString.length())
        {
          int k = paramString.charAt(j);
          if (((k < 97) || (k > 122)) && ((k < 65) || (k > 90)) && (k != 45))
            break;
          j++;
          continue;
        }
        else
        {
          i = 1;
        }
    }
    return i;
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.protocol.e
 * JD-Core Version:    0.6.0
 */